package com.twu.biblioteca;

import java.util.ArrayList;
import java.util.Iterator;

/**
 * Created by xndong on 10/2/14.
 */
public abstract class Show {

    private static MovieList movie;
    private static Library data;

    public static void BookList(ArrayList<Item> list) {
        Message("List Books : ");
        Iterator<Item> it = list.iterator();
        while (it.hasNext()) {
            BookInfo(it.next());
        }
    }

    public static void MovieList(ArrayList<Movie> list) {
        Message("List Movies : ");
        Iterator<Movie> it = list.iterator();
        while (it.hasNext()) {
            MovieInfo(it.next());
        }
    }

    private static void MovieInfo(Movie movie) {

        if (!movie.IsCheckOut){System.out.println(movie.toString());}
    }

    public static void BookInfo(Item book) {
        if (!book.IsCheckOut){
            System.out.println(book.Id + " " + book.Name + "\t" + book.Author + "\t" + book.PublishYear);
        }
    }

    public static void Message(String message) {
        System.out.println(message);
    }

    public static void HomePage() {
        Message("Main Menu : Quit(0) List Books(1)");
        BookList(data.bookList);
        MovieList(movie.movieList);
    }

    public static void UserInfo(Customer customer) {
        Message("User Information:");
        System.out.println(customer.Name + " " + customer.Email + "\t" + customer.Phone + "\t" + customer.Identity);
    }
}
